<!-- HTML header for doxygen 1.8.10-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<title>NATS C Client with JetStream and Streaming support: microService</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;" >
   <div id="projectname">NATS C Client with JetStream and Streaming support
   &#160;<span id="projectnumber">3.10.0-beta</span>
   </div>
   <div id="projectbrief">The nats.io C Client, Supported by Synadia Communications Inc.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__micro_service_functions.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">microService<div class="ingroups"><a class="el" href="group__micro_group.html">- Microservices</a> &raquo; <a class="el" href="group__micro_functions.html">Functions</a></div></div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2986a9751147b6f77064b5739635c2c1" id="r_ga2986a9751147b6f77064b5739635c2c1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_service_functions.html#ga2986a9751147b6f77064b5739635c2c1">micro_AddService</a> (<a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> **new_microservice, <a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *nc, <a class="el" href="group__micro_types.html#ga1e46c0657cf42e83b366d224f380fb55">microServiceConfig</a> *config)</td></tr>
<tr class="memdesc:ga2986a9751147b6f77064b5739635c2c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates and starts a new microservice.  <br /></td></tr>
<tr class="separator:ga2986a9751147b6f77064b5739635c2c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadcab5687b72ec24ef7ae647ea844ebc7" id="r_gadcab5687b72ec24ef7ae647ea844ebc7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_service_functions.html#gadcab5687b72ec24ef7ae647ea844ebc7">microService_AddEndpoint</a> (<a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *m, <a class="el" href="group__micro_types.html#ga7718d2f2c911e4cf677788f4ffe048cd">microEndpointConfig</a> *config)</td></tr>
<tr class="memdesc:gadcab5687b72ec24ef7ae647ea844ebc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds an endpoint to a microservice and starts listening for messages.  <br /></td></tr>
<tr class="separator:gadcab5687b72ec24ef7ae647ea844ebc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga26c62ec5b8ed46e1503bb62d8b066d9c" id="r_ga26c62ec5b8ed46e1503bb62d8b066d9c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_service_functions.html#ga26c62ec5b8ed46e1503bb62d8b066d9c">microService_AddGroup</a> (<a class="el" href="group__micro_types.html#ga2681ea21e9f5f6681b972bbb67e32133">microGroup</a> **new_group, <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *m, <a class="el" href="group__micro_types.html#ga8ea3d2aa37d1e89fb9c6d87c10dfe603">microGroupConfig</a> *config)</td></tr>
<tr class="memdesc:ga26c62ec5b8ed46e1503bb62d8b066d9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds an group (prefix) to a microservice.  <br /></td></tr>
<tr class="separator:ga26c62ec5b8ed46e1503bb62d8b066d9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga32ff6b2fb38eafb4df8e6b1039ee5984" id="r_ga32ff6b2fb38eafb4df8e6b1039ee5984"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_service_functions.html#ga32ff6b2fb38eafb4df8e6b1039ee5984">microService_Destroy</a> (<a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *m)</td></tr>
<tr class="memdesc:ga32ff6b2fb38eafb4df8e6b1039ee5984"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys a microservice, stopping it first if needed.  <br /></td></tr>
<tr class="separator:ga32ff6b2fb38eafb4df8e6b1039ee5984"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga20bb55e101c42a3b7172ea055b3ea04f" id="r_ga20bb55e101c42a3b7172ea055b3ea04f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_service_functions.html#ga20bb55e101c42a3b7172ea055b3ea04f">microService_GetConnection</a> (<a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *m)</td></tr>
<tr class="memdesc:ga20bb55e101c42a3b7172ea055b3ea04f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the connection associated with the service. If the service was successfully started, it is safe to assume it's not NULL, however it may already have been disconnected or closed.  <br /></td></tr>
<tr class="separator:ga20bb55e101c42a3b7172ea055b3ea04f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae7f5d4bde8ac12bde5ad48cebfad9e25" id="r_gae7f5d4bde8ac12bde5ad48cebfad9e25"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_service_functions.html#gae7f5d4bde8ac12bde5ad48cebfad9e25">microService_GetInfo</a> (<a class="el" href="group__micro_types.html#ga033705d0404de94efb7a6444c6e91743">microServiceInfo</a> **new_info, <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *m)</td></tr>
<tr class="memdesc:gae7f5d4bde8ac12bde5ad48cebfad9e25"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a <a class="el" href="group__micro_types.html#ga033705d0404de94efb7a6444c6e91743" title="Information about a running microservice.">microServiceInfo</a> for a microservice.  <br /></td></tr>
<tr class="separator:gae7f5d4bde8ac12bde5ad48cebfad9e25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf58eddc84ef124c80a86d380075ef226" id="r_gaf58eddc84ef124c80a86d380075ef226"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_service_functions.html#gaf58eddc84ef124c80a86d380075ef226">microService_GetState</a> (<a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *m)</td></tr>
<tr class="memdesc:gaf58eddc84ef124c80a86d380075ef226"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pointer to state data (closure). It is originally provided in <a class="el" href="structmicro__service__config__s.html#a0a0ae007824f6f53fbb0cb4b940c5ad2" title="A user-provided pointer to state data.">microServiceConfig.State</a>.  <br /></td></tr>
<tr class="separator:gaf58eddc84ef124c80a86d380075ef226"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga19b3b7126a1e2472a4970fc16b2f9fb4" id="r_ga19b3b7126a1e2472a4970fc16b2f9fb4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_service_functions.html#ga19b3b7126a1e2472a4970fc16b2f9fb4">microService_GetStats</a> (<a class="el" href="group__micro_types.html#gaf832de937edc57bcc3af5e1456b3760c">microServiceStats</a> **new_stats, <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *m)</td></tr>
<tr class="memdesc:ga19b3b7126a1e2472a4970fc16b2f9fb4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns run-time statistics for a microservice.  <br /></td></tr>
<tr class="separator:ga19b3b7126a1e2472a4970fc16b2f9fb4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac829b81893f09b1ed7c401147ed6b0c0" id="r_gac829b81893f09b1ed7c401147ed6b0c0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_service_functions.html#gac829b81893f09b1ed7c401147ed6b0c0">microService_IsStopped</a> (<a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *m)</td></tr>
<tr class="memdesc:gac829b81893f09b1ed7c401147ed6b0c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the service is stopped.  <br /></td></tr>
<tr class="separator:gac829b81893f09b1ed7c401147ed6b0c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaecde4e29e2b963e73fe4a8ff2fce064a" id="r_gaecde4e29e2b963e73fe4a8ff2fce064a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_service_functions.html#gaecde4e29e2b963e73fe4a8ff2fce064a">microService_Run</a> (<a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *m)</td></tr>
<tr class="memdesc:gaecde4e29e2b963e73fe4a8ff2fce064a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Waits for a microservice to stop.  <br /></td></tr>
<tr class="separator:gaecde4e29e2b963e73fe4a8ff2fce064a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga35de7172dac67472ac3890bc955b9b42" id="r_ga35de7172dac67472ac3890bc955b9b42"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__micro_service_functions.html#ga35de7172dac67472ac3890bc955b9b42">microService_Stop</a> (<a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *m)</td></tr>
<tr class="memdesc:ga35de7172dac67472ac3890bc955b9b42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops a running microservice.  <br /></td></tr>
<tr class="separator:ga35de7172dac67472ac3890bc955b9b42"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Functions that operate with <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a>. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga2986a9751147b6f77064b5739635c2c1" name="ga2986a9751147b6f77064b5739635c2c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2986a9751147b6f77064b5739635c2c1">&#9670;&#160;</a></span>micro_AddService()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * micro_AddService </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> **&#160;</td>
          <td class="paramname"><em>new_microservice</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> *&#160;</td>
          <td class="paramname"><em>nc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga1e46c0657cf42e83b366d224f380fb55">microServiceConfig</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section note"><dt>Note</dt><dd>The microservice should be destroyed to clean up using <a class="el" href="group__micro_service_functions.html#ga32ff6b2fb38eafb4df8e6b1039ee5984" title="Destroys a microservice, stopping it first if needed.">microService_Destroy</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">new_microservice</td><td>the location where to store the pointer to the new <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a> object. </td></tr>
    <tr><td class="paramname">nc</td><td>the <a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec" title="A connection to a NATS Server.">natsConnection</a> the service will use to receive and respond to requests. </td></tr>
    <tr><td class="paramname">config</td><td>a <a class="el" href="group__micro_types.html#ga1e46c0657cf42e83b366d224f380fb55" title="The microservice configuration object.">microServiceConfig</a> object with the configuration of the service. See <a class="el" href="structmicro__service__config__s.html" title="The Microservice top-level configuration object.">micro_service_config_s</a> for descriptions of the fields.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_service_functions.html#ga32ff6b2fb38eafb4df8e6b1039ee5984" title="Destroys a microservice, stopping it first if needed.">microService_Destroy</a>, <a class="el" href="group__micro_service_functions.html#gadcab5687b72ec24ef7ae647ea844ebc7" title="Adds an endpoint to a microservice and starts listening for messages.">microService_AddEndpoint</a>, <a class="el" href="group__micro_types.html#ga1e46c0657cf42e83b366d224f380fb55" title="The microservice configuration object.">microServiceConfig</a>, <a class="el" href="group__micro_types.html#ga7718d2f2c911e4cf677788f4ffe048cd" title="The Microservice endpoint configuration object.">microEndpointConfig</a> </dd></dl>

</div>
</div>
<a id="gadcab5687b72ec24ef7ae647ea844ebc7" name="gadcab5687b72ec24ef7ae647ea844ebc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadcab5687b72ec24ef7ae647ea844ebc7">&#9670;&#160;</a></span>microService_AddEndpoint()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microService_AddEndpoint </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *&#160;</td>
          <td class="paramname"><em>m</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga7718d2f2c911e4cf677788f4ffe048cd">microEndpointConfig</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Endpoints are currently destroyed when the service is stopped, there is no present way to remove or stop individual endpoints.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">m</td><td>the <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a> that the endpoint will be added to. </td></tr>
    <tr><td class="paramname">config</td><td>a <a class="el" href="group__micro_types.html#ga7718d2f2c911e4cf677788f4ffe048cd" title="The Microservice endpoint configuration object.">microEndpointConfig</a> object with the configuration of the endpoint. See <a class="el" href="structmicro__endpoint__config__s.html">micro_endpoint_config_s</a> for descriptions of the fields.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_service_functions.html#ga32ff6b2fb38eafb4df8e6b1039ee5984" title="Destroys a microservice, stopping it first if needed.">microService_Destroy</a>, <a class="el" href="group__micro_types.html#ga7718d2f2c911e4cf677788f4ffe048cd" title="The Microservice endpoint configuration object.">microEndpointConfig</a> </dd></dl>

</div>
</div>
<a id="ga26c62ec5b8ed46e1503bb62d8b066d9c" name="ga26c62ec5b8ed46e1503bb62d8b066d9c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga26c62ec5b8ed46e1503bb62d8b066d9c">&#9670;&#160;</a></span>microService_AddGroup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microService_AddGroup </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga2681ea21e9f5f6681b972bbb67e32133">microGroup</a> **&#160;</td>
          <td class="paramname"><em>new_group</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *&#160;</td>
          <td class="paramname"><em>m</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga8ea3d2aa37d1e89fb9c6d87c10dfe603">microGroupConfig</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Groups are associated with a service, and are destroyed when the service is destroyed.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">new_group</td><td>the location where to store the pointer to the new <a class="el" href="group__micro_types.html#ga2681ea21e9f5f6681b972bbb67e32133" title="a collection of endpoints and other groups, with a common prefix to their subjects and names.">microGroup</a> object. </td></tr>
    <tr><td class="paramname">m</td><td>the <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a> that the group will be added to. </td></tr>
    <tr><td class="paramname">config</td><td>group parameters.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_group_functions.html#gade7fd0f2080a2e647b79c20a5019394d" title="Adds a sub-group to microGroup.">microGroup_AddGroup</a>, <a class="el" href="group__micro_group_functions.html#gabc9641ad7ee7775c388c864f2ffa6883" title="Adds an endpoint to a microGroup and starts listening for messages.">microGroup_AddEndpoint</a> </dd></dl>

</div>
</div>
<a id="ga32ff6b2fb38eafb4df8e6b1039ee5984" name="ga32ff6b2fb38eafb4df8e6b1039ee5984"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga32ff6b2fb38eafb4df8e6b1039ee5984">&#9670;&#160;</a></span>microService_Destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microService_Destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *&#160;</td>
          <td class="paramname"><em>m</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section note"><dt>Note</dt><dd>This function may fail while stopping the service, do not assume unconditional success if clean up is important.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">m</td><td>the <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a> to stop and destroy.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_service_functions.html#ga35de7172dac67472ac3890bc955b9b42" title="Stops a running microservice.">microService_Stop</a>, <a class="el" href="group__micro_service_functions.html#gaecde4e29e2b963e73fe4a8ff2fce064a" title="Waits for a microservice to stop.">microService_Run</a> </dd></dl>

</div>
</div>
<a id="ga20bb55e101c42a3b7172ea055b3ea04f" name="ga20bb55e101c42a3b7172ea055b3ea04f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga20bb55e101c42a3b7172ea055b3ea04f">&#9670;&#160;</a></span>microService_GetConnection()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec">natsConnection</a> * microService_GetConnection </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *&#160;</td>
          <td class="paramname"><em>m</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">m</td><td>the <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__types_group.html#gaf88dca0a18efb5c5e994d265a9f04aec" title="A connection to a NATS Server.">natsConnection</a> associated with the service. </dd></dl>

</div>
</div>
<a id="gae7f5d4bde8ac12bde5ad48cebfad9e25" name="gae7f5d4bde8ac12bde5ad48cebfad9e25"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae7f5d4bde8ac12bde5ad48cebfad9e25">&#9670;&#160;</a></span>microService_GetInfo()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microService_GetInfo </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#ga033705d0404de94efb7a6444c6e91743">microServiceInfo</a> **&#160;</td>
          <td class="paramname"><em>new_info</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *&#160;</td>
          <td class="paramname"><em>m</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section note"><dt>Note</dt><dd>the <a class="el" href="group__micro_types.html#ga033705d0404de94efb7a6444c6e91743" title="Information about a running microservice.">microServiceInfo</a> struct returned by this call should be freed with <a class="el" href="group__micro_cleanup_functions.html#ga9b4756ed693ce4fc0f06375aa0d3d54c" title="Destroys a microServiceInfo object.">microServiceInfo_Destroy</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">new_info</td><td>receives the pointer to the <a class="el" href="group__micro_types.html#ga033705d0404de94efb7a6444c6e91743" title="Information about a running microservice.">microServiceInfo</a>. </td></tr>
    <tr><td class="paramname">m</td><td>the <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a> to query.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_types.html#ga033705d0404de94efb7a6444c6e91743" title="Information about a running microservice.">microServiceInfo</a>, <a class="el" href="structmicro__service__info__s.html">micro_service_info_s</a> </dd></dl>

</div>
</div>
<a id="gaf58eddc84ef124c80a86d380075ef226" name="gaf58eddc84ef124c80a86d380075ef226"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf58eddc84ef124c80a86d380075ef226">&#9670;&#160;</a></span>microService_GetState()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void * microService_GetState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *&#160;</td>
          <td class="paramname"><em>m</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">m</td><td>the <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the state pointer.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_types.html#ga1e46c0657cf42e83b366d224f380fb55" title="The microservice configuration object.">microServiceConfig</a> </dd></dl>

</div>
</div>
<a id="ga19b3b7126a1e2472a4970fc16b2f9fb4" name="ga19b3b7126a1e2472a4970fc16b2f9fb4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga19b3b7126a1e2472a4970fc16b2f9fb4">&#9670;&#160;</a></span>microService_GetStats()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microService_GetStats </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf832de937edc57bcc3af5e1456b3760c">microServiceStats</a> **&#160;</td>
          <td class="paramname"><em>new_stats</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *&#160;</td>
          <td class="paramname"><em>m</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section note"><dt>Note</dt><dd>the <a class="el" href="group__micro_types.html#gaf832de937edc57bcc3af5e1456b3760c" title="The Microservice service-level stats struct.">microServiceStats</a> struct returned by this call should be freed with <a class="el" href="group__micro_cleanup_functions.html#gaabcbf8378e6221eea78493a26576c8ce" title="Destroys a microServiceStats object.">microServiceStats_Destroy</a>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">new_stats</td><td>receives the pointer to the <a class="el" href="group__micro_types.html#gaf832de937edc57bcc3af5e1456b3760c" title="The Microservice service-level stats struct.">microServiceStats</a>. </td></tr>
    <tr><td class="paramname">m</td><td>the <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a> to query.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_types.html#gaf832de937edc57bcc3af5e1456b3760c" title="The Microservice service-level stats struct.">microServiceStats</a>, <a class="el" href="structmicro__service__stats__s.html">micro_service_stats_s</a> </dd></dl>

</div>
</div>
<a id="gac829b81893f09b1ed7c401147ed6b0c0" name="gac829b81893f09b1ed7c401147ed6b0c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac829b81893f09b1ed7c401147ed6b0c0">&#9670;&#160;</a></span>microService_IsStopped()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> bool microService_IsStopped </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *&#160;</td>
          <td class="paramname"><em>m</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">m</td><td>the <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if stopped, otherwise <code>false</code>.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_service_functions.html#ga2986a9751147b6f77064b5739635c2c1" title="Creates and starts a new microservice.">micro_AddService</a>, <a class="el" href="group__micro_service_functions.html#ga35de7172dac67472ac3890bc955b9b42" title="Stops a running microservice.">microService_Stop</a>, <a class="el" href="group__micro_service_functions.html#gaecde4e29e2b963e73fe4a8ff2fce064a" title="Waits for a microservice to stop.">microService_Run</a> </dd></dl>

</div>
</div>
<a id="gaecde4e29e2b963e73fe4a8ff2fce064a" name="gaecde4e29e2b963e73fe4a8ff2fce064a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaecde4e29e2b963e73fe4a8ff2fce064a">&#9670;&#160;</a></span>microService_Run()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microService_Run </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *&#160;</td>
          <td class="paramname"><em>m</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><a class="el" href="group__micro_service_functions.html#ga2986a9751147b6f77064b5739635c2c1" title="Creates and starts a new microservice.">micro_AddService</a> starts the service with async subscriptions. <a class="el" href="group__micro_service_functions.html#gaecde4e29e2b963e73fe4a8ff2fce064a" title="Waits for a microservice to stop.">microService_Run</a> waits for the service to stop.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">m</td><td>the <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> for invalid arguments, otherwise always succeeds.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_service_functions.html#ga2986a9751147b6f77064b5739635c2c1" title="Creates and starts a new microservice.">micro_AddService</a>, <a class="el" href="group__micro_service_functions.html#ga35de7172dac67472ac3890bc955b9b42" title="Stops a running microservice.">microService_Stop</a> </dd></dl>

</div>
</div>
<a id="ga35de7172dac67472ac3890bc955b9b42" name="ga35de7172dac67472ac3890bc955b9b42"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga35de7172dac67472ac3890bc955b9b42">&#9670;&#160;</a></span>microService_Stop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7">microError</a> * microService_Stop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28">microService</a> *&#160;</td>
          <td class="paramname"><em>m</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Drains and closes the all subscriptions (endpoints and monitoring), resets the stats, and calls the <code>Done</code> callback for the service, so it can do its own clean up if needed.</p>
<p>It is possible that this call encounters an error while stopping the service, in which case it aborts and returns the error. The service then may be in a partially stopped state, and the <code>Done</code> callback will not have been called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">m</td><td>the <a class="el" href="group__micro_types.html#gaf6f5aef8773b70746e84c100c2b19b28" title="the main object for a configured microservice.">microService</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="group__micro_types.html#ga41ae4121cf2f8e326369bbc2e44e20d7" title="the Microservice error object.">microError</a> if an error occurred.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__micro_service_functions.html#ga2986a9751147b6f77064b5739635c2c1" title="Creates and starts a new microservice.">micro_AddService</a>, <a class="el" href="group__micro_service_functions.html#gaecde4e29e2b963e73fe4a8ff2fce064a" title="Waits for a microservice to stop.">microService_Run</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">NATS.IO Supported By Synadia Communications Inc.
    <a href="http://www.nats.io">
    </a></li>
  </ul>
</div>
</body>
</html>
